package com.magold.skill;

import org.andengine.entity.scene.Scene;

import android.util.Log;

import com.magold.touch.IHoldDetector;
import com.magold.touch.IHoldDetector.IHoldListener;

public class SuppressTouchListener implements IHoldListener {
	private SuppressSkill mSkill;
	
	public SuppressTouchListener(SuppressSkill pSkill) {
		mSkill = pSkill;
	}
	
	@Override
	public void onHoldStarted(Scene pScene, IHoldDetector pDetector) {
		Log.d("HoldListener", "START hold @" + pDetector.getHoldX() + ", " + pDetector.getHoldY());
		mSkill.launch();
	}

	@Override
	public void onHold(Scene pScene, IHoldDetector pDetector) {
		Log.d("HoldListener", "CONTINUE hold @" + pDetector.getHoldX() + ", " + pDetector.getHoldY());
	}

	@Override
	public void onHoldFinished(Scene pScene, IHoldDetector pDetector, boolean pMaxDistanceExceeded) {
		Log.d("HoldListener", "FINISH hold @" + pDetector.getHoldX() + ", " + pDetector.getHoldY());
		mSkill.stop();
	}

}
